# 可以使用类的静态属性做枚举

# 字典枚举

# pttype = {
#     'JNT': 17,
#     'SND': 18
# }

# print(pttype['JNT'])

# from enum import Enum, unique

# # 枚举类

# @unique
# class Pttype(Enum):
#     JNT = 17
#     SND = 18
#     # @unique 可以确保没有重复的枚举
#     # JNT = 17

# print(Pttype.JNT)
# print(Pttype.JNT.value)

from enum import Enum, unique

@unique
class Gender(Enum):
    MALE = 0
    FEMALE = 1

class Student(object):
    def __init__(self, nm, gender):
        self.__nm = nm
        self.__gender = gender
    @property
    def gender(self):
        return self.__gender
        
bb = Student('Bob', Gender.FEMALE)

print(bb.gender)